
import store from '../store'
import router from '../router'


// let topPath = ['/music','/recommend', '/rank','/singer']
let topPath = ['/music']

router.afterEach((to, from, next) => {
	// 判断当前是否一级路由, 是的话将启用侧边栏按钮
	let use = true;
	if (!topPath.includes(to.path)) {
		use = false;
	}
	// 当都是一级路由时不触发 useSideBar ,减少开销
	if (use != store.state.usesideBar) {
		store.commit('useSideBar', use)
	}

})
export default { router, store }